<%@ page import="com.po.Comment" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    HttpSession session1 = request.getSession(false);
    String note_name = null;
    String note_content = null;
    List<Comment> comments = null;
    if (session1 == null || session1.getAttribute("id") == null) {
        response.sendRedirect(request.getContextPath() + "/index.jsp");
    }else{
        comments = (List<Comment>) request.getAttribute("comments");
        note_name = (String) request.getAttribute("note_name");
        note_content = (String) request.getAttribute("note_content");
    }
%>
<a href="<%=request.getContextPath()%>/function/myEnvelope">返回我的信封</a>
<p>
<h3><%=note_name%>
</h3>
<%=note_content%>
<hr>

<%
    if(comments.isEmpty()){
        out.print("您的纸条还没有人评论");
    }else{
        for(Comment comment : comments){
%>
<p>
    用户：<%=comment.getUser_name()%>:<br><br>
    <%=comment.getContent()%>
</p>
<hr color="pink">
<%
        }
    }
%>
<style>
    body {
        background-image: url("../picture/new.jpg");
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center center;
        background-size: 100% 100%;
    }
</style>
